#!/bin/bash
#./win-to-ubuntu.sh
cd /home/pi/iot-gateway/
echo "start to compile"
export PKG_CONFIG_SYSROOT_DIR=/usr/lib/aarch64-linux-gnu
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
cargo build --manifest-path /home/pi/iot-gateway/Cargo.toml  --release --package iot_gateway --bin iot_gateway --target=aarch64-unknown-linux-gnu
echo "start to scp file"
#sshpass -p "admin" scp -o StrictHostKeyChecking=no -P 32000 /home/pi/iot-gateway/target/aarch64-unknown-linux-gnu/release/iot_gateway pi@dudusisi.asuscomm.com:~/iot/tmp/
sshpass -p "admin" scp -o StrictHostKeyChecking=no -P 22 /home/pi/iot-gateway/target/aarch64-unknown-linux-gnu/release/iot_gateway pi@192.168.50.134:~/iot/tmp/
echo "scped file"